import mx.transitions.*;
import mx.transitions.easing.*;

function launch(target:MovieClip, transParams:Object, transListener:Object)
{
	var transitionMgr:TransitionManager=new TransitionManager(target);
	if (transListener!=null)
	{
		transitionMgr.addEventListener("allTransitionsInDone", transListener);
		transitionMgr.addEventListener("allTransitionsOutDone", transListener);
	}
	transitionMgr.startTransition(transParams);
}

function pixelDissolve(target:MovieClip)
{
	TransitionManager.start(target, {type:PixelDissolve, direction:Transition.IN, duration:2, easing:Strong.easeOut, xSections:20, ySections:20}); 
}

function fadeType1(target:MovieClip)
{
	TransitionManager.start(target, {type:Fade, direction:Transition.IN, duration:3, easing:None.easeNone});
}

function photoType1(target:MovieClip)
{
	TransitionManager.start(target, {type:Photo, direction:Transition.IN, duration:5, easing:None.easeNone});
}

function irisType1(target:MovieClip)
{
	if (Packages.system.display.SceneTransition.processFlag) return;	// @tmp

	var transitionMgr:TransitionManager=new TransitionManager(target);
	transitionMgr.startTransition({type:Iris, direction:Transition.IN, duration:2, easing:Strong.easeOut, startPoint:0, shape:Iris.CIRCLE});
}

function flyType1(target:MovieClip)
{
	var transitionMgr:TransitionManager=new TransitionManager(target);
	transitionMgr.startTransition({type:Fly, direction:Transition.IN, duration:3, easing:Elastic.easeOut, startPoint:1});

	/*var transListener:Object=new Object();
	transListener.allTransitionsInDone=function(eventObj:Object) 
	{
		Packages.log("allTransitionsInDone event occurred.", "debug");
	};
	transitionMgr.addEventListener("allTransitionsInDone", transListener);*/
}

function flyType3(target:MovieClip, onFinishedHandler)
{
	var transitionMgr:TransitionManager=new TransitionManager(target);
	transitionMgr.startTransition({type:Fly, direction:Transition.IN, duration:3, easing:Elastic.easeOut, startPoint:3});

	var transListener:Object=new Object();
	transListener.allTransitionsInDone=onFinishedHandler;
	transitionMgr.addEventListener("allTransitionsInDone", transListener);
}